from pydantic import BaseSettings


class Settings(BaseSettings):
    db_host: str = "localhost"
    db_port: int = 5432
    db_user: str = "postgres"
    db_password: str = "password"
    db_name: str = "fastapi_db"
    consul_host: str = "localhost"
    consul_port: int = 8500

    # gRPC配置
    grpc_host: str = "[::]"  # 0.0.0.0  ( IPv6地址 [::] 可以同时接受IPv4和IPv6连接 )
    grpc_port: int = 50051

    class Config:
        env_file = ".env"


settings = Settings()
